﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>中国信息服务</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="<c:url value='/admin/css/common.css'/>" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<c:url value='/admin/js/util/jquery-1.8.1.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/admin/js/util/jquery.easing.1.3.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/admin/js/util/jquery.jerichotab.js'/>"></script>
    <script type="text/javascript">
        var tabcount = 0;
        var cng95598 = {
            showLoader: function() {
                $('#loader').css('display', 'block');
            },
            removeLoader: function() {
                $('#loader').css('display', 'none');
            },
            buildMenu: function() {
                $('span.func').click(function() {
                    $.fn.jerichoTab.addTab({
                        tabFirer: $(this),
                        title: $(this).text(),
                        closeable: true,
                        data: {
                            dataType: $(this).attr('dataType'),
                            dataLink: $(this).attr('dataLink')
                        }
                    }).showLoader().loadData();
                    tabcount += 1;
                });
            },
            buildTabpanel: function() {
                var rheight;
                if (window.ActiveXObject)
                    rheight = $('.right').height() -67;
                else
                    rheight = $('.right').height() -67;
                $.fn.initJerichoTab({
                    renderTo: '.right',
                    uniqueId: 'welcome',
                    contentCss: { 'height': rheight },
                    tabs: [{
                            title: '欢迎页面',
                            closeable: false,
                            //iconImg: 'images/jerichotab.png',
                            data: { dataType: 'iframe', dataLink: 'welcome.html' },
                            onLoadCompleted: function(h) {
                                //$('<b style="color:red" />').html('The JerichoTab processed in ' + (new Date().getTime() - d1) + ' milliseconds!').appendTo(h);
                            }
                        }],
                    activeTabIndex: 0,
                    loadOnce: true
                });
            }
        };
            
        $(document).ready(function() {
            $('#submenubox h4.item').click(function() {
            	if($(this).next('ul').css("display") == "inline-block") {
            		$(this).next('ul').slideUp('fast');
            		$(this).next('ul').css("display","none");
            	} else {
            		$(this).next('ul').slideDown('fast');
            		$(this).next('ul').css("display","inline-block");
            	}
                //$('#submenubox li').children('ul').slideUp('fast');               
                //$(this).siblings('ul').slideDown('fast');
				// style="display:inline-block"
				//$(this).siblings('ul').css("display","inline-block");
                return false;
            });

            cng95598.showLoader();
            cng95598.buildMenu();
            cng95598.buildTabpanel();
            cng95598.removeLoader();

            $("#switchPoint").mouseover(function() {
                var title = $("#switchPoint").attr("title");
                if (title == "收起左栏")
                    $("#switchPoint").attr("style", "background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:-20px -11px;");
                else
                    $("#switchPoint").attr("style", "background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:-60px -11px;");
            }).mouseout(function() {
                var title = $("#switchPoint").attr("title");
                if (title == "收起左栏")
                    $("#switchPoint").attr("style", "background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:0px -11px;");
                else
                    $("#switchPoint").attr("style", "background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:-40px -11px;");
            });
        });

        function switchSysBar() {
            var title = $("#switchPoint").attr("title");
            var width = $(window).width();
            if (title == "收起左栏") {
                $("#switchPoint").attr("title", "恢复左栏");
                $("#switchPoint").attr("style", "background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:-40px -11px;");

                document.getElementById("left").style.display = "none";
                $("#right").css("width", (width) + "px");
            }
            else {
                $("#switchPoint").attr("title", "收起左栏");
                document.getElementById("left").style.display = "";
                width = width - 210;
                $("#right").css("width", (width) + "px");
            }

            if (tabcount == 0)
                $("#jerichotabiframe_0").css("width", (width) + "px");
            else {
                for (var i = 0; i <= tabcount; i++) {
                    $("#jerichotabiframe_" + i).css("width", (width) + "px");
                }
            }
        }

        function onmousemoveClass(obj) {            
            var myClass = $(obj).attr("class");
            if (myClass && (myClass == "liHoverSelected")) {
            	
            } else {
            	if (myClass)
            		$(obj).attr("class", "liHover");
            	else
            		$(obj).addClass("liHover");
            }
        }
        
        function onmouseoutClass(obj) {
        	var myClass = $(obj).attr("class");
            if (myClass && (myClass == "liHoverSelected")) {
            	
            } else {
            	if (myClass)
            		$(obj).attr("class", "liOut");
            	else
            		$(obj).addClass("liOut");
            }
        }
        
        function onclickClass(obj) {
        	$("li[id^='subMenu']").removeClass();
        	var myClass = $(obj).attr("class");
           	if (myClass)
           		$(obj).attr("class", "liHoverSelected");
           	else
           		$(obj).addClass("liHoverSelected");
        }
        
        function loginOut() {
        	window.location.href = "<c:url value='/admin/frameAction!loginOut.do'/>";
        }
	</script>
</head>
<body>
    <div id="top">
	    <div id="topRight">
    	    <ul class="promptWords">
        	    <li><img alt="" src="<c:url value='/admin/images/ico/home.gif'/>" /><a href="#">网站首页</a></li>               
                <li><img alt="" src="<c:url value='/admin/images/ico/exit.gif'/>" /><a href="javascript:loginOut();">退出登录</a></li>
                <li><img alt="" src="<c:url value='/admin/images/ico/help.gif'/>" /><a href="#">帮助中心</a></li>
                <li><img alt="" src="<c:url value='/admin/images/ico/feedback.gif'/>" /><a onclick="test()" href="javascript:;">反馈意见</a></li>
            </ul>
            <ul class="skin">
        	    <li class="deepBlue_click"><a href="#">&nbsp;</a></li>
                <li class="grey"><a href="#">&nbsp;</a></li>
                <li class="paleGreen"><a href="#">&nbsp;</a></li>
                <li class="paleBlue"><a href="#">&nbsp;</a></li>
            </ul>
        </div>
    </div>
    <div id="left">
        <h2>功能菜单</h2>
        <ul id="submenubox">
            <li>
            	<c:forEach items="${ sessionScope.adminLoginToken.menuOneSetList }" var="item1" varStatus="status1">
            		<h4 class="item leftMenuFive"><a href="javascript:void(0)">${ item1.name }</a></h4>
            		<ul class="submenu" style="display: none;">
            		<c:forEach items="${ sessionScope.adminLoginToken.menuTwoSetMap }" var="item2" varStatus="status2">
            			<c:if test="${ item2.key == item1.id }">
            				<c:forEach items="${ item2.value }" var="item3" varStatus="status3">
            					<li id="subMenu1${ status3.index }" onmousemove="onmousemoveClass(this)" onmouseout="onmouseoutClass(this)" onclick="onclickClass(this)"><span class="func" datalink="<c:url value='${ item3.url }'/>" datatype="iframe"><c:out value="${ item3.name }"/></span></li>
            				</c:forEach>
            			</c:if>
            		</c:forEach>
            		</ul>
            	</c:forEach>
	        </li>
        </ul>
    </div>
    <div id="switchPoint" title="收起左栏" onclick="switchSysBar();" style="background-image:url(<c:url value='/admin/images/a.gif'/>); background-position:0 -11px;"></div>
    <div id="right" class="right"></div>
    <div id="loader">Loading...</div>
    <script type="text/javascript">
        //左边
        var height = $(window).height() - 45;
        var width;
        if (window.ActiveXObject)
            width = $(window).width() - 200;
        else
            width = $(window).width() - 202;
        $("#left").css("height", (height) + "px");
        $("#right").css("height", (height) + "px");
        $("#right").css("width", (width) + "px");
    </script>
</body>
</html>
